import gameManager from "./gameManager";

const {ccclass, property} = cc._decorator;

@ccclass
export default class bgManager extends cc.Component {

    @property(cc.Node)
    cloud1:cc.Node = null;
    @property(cc.Node)
    cloud2:cc.Node = null;

    private game:gameManager = null;

    init(game:gameManager){
        this.game = game;
    }
    onLoad () {}

    start () {

    }

    update (dt) {
        if(this.game.isStart){
            this.cloud1.x -= 1
            this.cloud2.x -= 1
            if(this.cloud1.x <= -cc.winSize.width){
                this.cloud1.x = cc.winSize.width
            }
            if(this.cloud2.x <= -cc.winSize.width){
                this.cloud2.x = cc.winSize.width
            }
        }
    }
}
